import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { useEffect } from "react";
import { useLocation } from "react-router-dom";

const NProgressLoading = () => {
  const location = useLocation();
  useEffect(() => {
    NProgress.start();
    console.log("动画开始");

    setTimeout(() => {
      NProgress.done();
    }, 600);
    return () => {
      NProgress.done();
    };
  }, [location.pathname]);
  return <div>123</div>;
};

export default NProgressLoading;
